/************************************************************
* @file   gkt_rand.c
************************************************************/

#include "gkt_board.h"
#include "gkt_defines.h"
#include "gkt_driver.h"
#include "gkt_rand.h"
#include "g_rand.h"

uint32_t gkt_rand(void)
{
	uint32_t rand_number=0;
	uint8_t rand[4];

	G_RAND_RandP(&rand, 4, NULL);
	rand_number = (rand[3] << 24) | (rand[2] << 16) | (rand[1] << 8) | rand[0];
	
	return rand_number;
}

int gkt_rand_init(void)
{
	G_RAND_Init();
	return GKT_SUCCESS;
}

GKT_DEVICE_DESC_DEFINE(rand, NORMAL);


